<?php
require_once('../phplib/include.inc.php');

class DoAddProduct{
	public function DoAdd(){
		Util::ValidateRight(array(1,2),'or');
		$R = $_REQUEST;		
		
		$tid = intval($R['ptype']);
		$cxrl = ($R['cxrl']);
		$gjcl = $R['gjcl'];
		$hfbh = ($R['hfbh']);
		$sssd = ($R['sssd']);
		$dhcd = ($R['dhcd']);
		$tlxz = ($R['tlxz']);
		$hsxz = ($R['hsxz']);
		$czms = ($R['czms']);
		$hscl = $R['hscl'];
		$hszj = ($R['hszj']);
		$bhqt = $R['bhqt'];
		$arr = array($tid,$cxrl,$gjcl,$hfbh,$sssd,$dhcd,$tlxz,$hsxz,$czms,$hscl,$hszj,$bhqt);
		/* @var $db DbMySQL */
		$db = getDb();
		$db->connect();
		$sql = "INSERT INTO
				  `product_t`(
				  tid,
				  cxrl,
				  gjcl,
				  hfbh,
				  sssd,
				  dhcd,
				  tlxz,
				  hsxz,
				  czms,
				  hscl,
				  hszj,
				  bhqt)
				VALUES(
				  {0},
				  {1},
				  {2},
				  {3},
				  {4},
				  {5},
				  {6},
				  {7},
				  {8},
				  {9},
				  {10},
				  {11})";
		$re = $db->execute($sql,$arr);
		if($re === false){
			PageBase::Error('添加焊接数据时出错，未知错误，请与技术人员联系.');
		}
		$id = $db->insertId();
		Util::AddLog("添加焊接数据: $sjmm ，添加后的id为： $id ");
		PageBase::Go('../home/productadmin.php');
	}
}
$doaddproduct = new DoAddProduct();
$doaddproduct->DoAdd();
?>